<template>
  <el-dialog
    title="详情"
    :close-on-click-modal="false"
    :visible.sync="visible"
  >
  <el-form
      :model="dataForm"
      ref="dataForm"
      @keyup.enter.native="dataFormSubmit()"
      label-width="150px"
    >
      <el-form-item label="登录帐号:" >
        {{dataForm.username}}
      </el-form-item>
      <el-form-item label="手机号:" >
        {{dataForm.mobile}}
      </el-form-item>
      <el-form-item label="创建时间:" >
        {{dataForm.createTime}}
      </el-form-item>
      <el-form-item label="用户姓名:" >
        {{dataForm.name}}
      </el-form-item>
      <el-form-item label="社区id:" >
        {{dataForm.communityId}}
      </el-form-item>
      <el-form-item label="社区名称:" >
        {{dataForm.communityName}}
      </el-form-item>
      <el-form-item label="类型:" prop="state">
        <div v-if="dataForm.type == 1">普通会员</div>
        <div v-if="dataForm.type == 2">超级会员</div>
        <div v-if="dataForm.type == 3">普通用户</div>
      </el-form-item>
      <el-form-item label="邀请码:" >
        {{dataForm.invitationCode}}
      </el-form-item>
      <el-form-item label="积分总数:" >
        {{dataForm.point}}
      </el-form-item>
      <el-form-item label="是否认证:" prop="authentication">
        <div v-if="dataForm.authentication == 0">是</div>
        <div v-if="dataForm.authentication == 1">否</div>
      </el-form-item>
      <el-form-item label="会员过期时间:" >
        {{dataForm.memberEndTime}}
      </el-form-item>
      </el-form>

    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      imageUrl: '',
      visible: false,
      dialogImageUrl: "",
      dialogVisible: false,
      disabled: false,
      dataForm: {
        id: "",
        wldh: ""
      },
      dataRule: {
        wldh: [{ required: true, message: "物流单号不能为空", trigger: "blur" }],
      },
    };
  },
  methods: {
    init(id) {
      this.dataForm.id = id;
      this.visible = true;
      this.$http({
            url: this.$http.adornUrl(
              `yshbms/user/info/${this.dataForm.id}`
            ),
            method: "get",
            params: this.$http.adornParams(),
          }).then(({ data }) => {
            if (data && data.code === 0) {
              this.dataForm= data.userEntity;
            }
          });
      this.$nextTick(() => {
        this.$refs["dataForm"].resetFields();
      });
    },
  },
};
</script>
<style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>